'use strict'

module.exports = app => {
  class Main extends app.Service {
    async list() {
      const { time } = this.ctx.query
      const { comments, replies } = await this.ctx.service.message.list({
        uid: this.ctx.session.user.id,
        time: time || this.ctx.session.user.login_at,
      })
      this.ctx.body = { comments, replies }
    }

  }

  return Main;
};
